<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<title>Continuous Measurement and Logging</title>
<style>

<!--

/***************************************************/

/* MINIMAL STYLES */

/* The following section defines styles that every HTML Help project should need. */



/* Specifies White Background color */

body {background-color:#FFFFFF; font-family:Verdana, sans-serif; font-size:8pt; color: #000000;}



/* The default style of P is red to alert you that you need to apply a style class, such as Body. */

P { margin-top:6.00pt; margin-bottom:6.00pt;}



BR { font-size:4.00pt; }



/* Use H1 for all topic headings. */

H1 { margin-top:3.00pt; margin-bottom:3.00pt; font-size:150%; font-weight:bold;  }



/* Use H2 for second-level headings. */

H2 { margin-top:9.00pt; margin-bottom:3.00pt; font-size:125%; font-weight:bold;  }



/* Use H3 for third-level headings. */

H3 { margin-top:6.00pt; margin-bottom:3.00pt; font-size:100%; font-weight:bold;  }



/* Use H4 for fourth-level headings. */

H4 { margin-top:6.00pt; margin-bottom:3.00pt; font-size:100%; font-weight:bold;  }



/* H5 and H6 have the same definition as H4 because you should not need this level of heading in one topic. If you need to use H5 or H6, consider breaking up your topic into more than one topic. */

H5 { margin-top:6.00pt; margin-bottom:3.00pt; font-size:100%; font-weight:bold;  }

H6 { margin-top:6.00pt; margin-bottom:3.00pt; font-size:100%; font-weight:bold;  }



/* Use the Body style class for normal paragraphs. */

P.Body {  }



/* Use the Anchor style class for graphic references on a line by themselves. */

P.Anchor { font-size:125%;  }



/* Use the Indent style classes to indent a paragraph. If you need to indent text below a list item, use <br><br> to start the new paragraph within the same set of <li></li> tags. If you need to indent a list within another list, nest the indented list within the first list's set of <ol></ol> or <ul></ul> tags. */

P.Indent1 { margin-left:12.00pt; margin-bottom:3.00pt;  }

P.Indent2 { margin-left:24.00pt; margin-bottom:3.00pt;  }

P.Indent3 { margin-left:36.00pt; margin-bottom:3.00pt;  }

P.Indent4 { margin-left:48.00pt; margin-bottom:3.00pt;  }

P.Indent5 { margin-left:60.00pt; margin-bottom:3.00pt;  }



/* Use the LI style for all list items. */

LI { margin-top:3.00pt; margin-bottom:3.00pt; }



/* Use the OL style for numbered lists. You do not have to type the number for each list item in a numbered list. */

OL { margin-left:22.00pt; margin-top:3.00pt; margin-bottom:3.00pt; text-indent:0pt; list-style-type: decimal; }



/* Use the OL style for numbered lists. Nested lists will use the bullet types according to the nesting scheme below */

ol ol {list-style-type:lower-alpha}

ol ol ol {list-style-type:decimal}

ol ol ol ol {list-style-type:lower-alpha}

ol ol ol ol ol {list-style-type:decimal}

ol ol ol ol ol ol {list-style-type:lower-alpha}

ol ol ol ol ol ol ol {list-style-type:decimal}

ol ol ol ol ol ol ol ol {list-style-type:lower-alpha}





/* Use the EquationNum style class for numbered lists of equations. You do not have to type the number for each list item in a numbered list. */

OL.EquationNum { margin-left:36.00pt; text-indent:0pt; list-style-type: decimal; }



/* Use the List-abc style class for lettered lists. You do not have to type the letter for each list item in a lettered list. */

OL.List-abc { margin-left:22.00pt; text-indent:0pt; list-style-type:lower-alpha; }



/* Use the UL style for bulleted lists. You do not have to type the bullet for each list item in a bulleted list. */

UL { margin-left:22.00pt; text-indent:0pt; margin-top:3.00pt; margin-bottom:3.00pt; list-style-type: disc; }



/* Use the UL style for bulleted lists. Nested lists will use the bullet types according to the nesting scheme below. */

ul ul {list-style-image: none;list-style-type: circle}

ul ul ul {list-style-image:none;list-style-type:disc}

ul ul ul ul {list-style-image: none;list-style-type: circle}

ul ul ul ul ul {list-style-image:none;list-style-type:disc}

ul ul ul ul ul ul {list-style-image: none;list-style-type: circle}

ul ul ul ul ul ul ul {list-style-image:none;list-style-type:disc}

ul ul ul ul ul ul ul ul ul{list-style-image: none;list-style-type: circle}



/* Use the List-Box style class for bulleted lists with boxes instead of bullets. You do not have to type the box for each list item in a box list. */

UL.List-Box { list-style-image: none;list-style-type: square}



Table { font-size:100%; }



/* Use the Borderless style class for tables that do not need borders, such as for 2-column or 3-column lists with no headings. */

Table.Borderless { border:none; }



/* Use the Bordered style class for tables that need borders. */

Table.Bordered { border-width: 1pt; border-style: solid; border-color: #000000; border-collapse: collapse; }



/* Use the TD style for table cells in Borderless or Borderless-Wide tables. */

TD { vertical-align:top; padding:3px; }



/* Use the Bordered style class for table headings and cells in Bordered or Bordered-Wide tables. */

.Bordered { border-width: 1pt; border-style: solid; border-color: #000000; }



/* Use the Icon style class for table cells that contain note, caution, warning, or tip icons, or LabVIEW datatype terminals. */

TD.Icon { width:40px; }



/* Use the TH style for table heading cells in Borderless or Borderless-Wide tables. */

TH { font-weight:bold; padding:3px; }



/* Use the Left-Align style class for table headings and cells that you want to left align instead of center align. */

.Left-Align { text-align:left; }



/***************************************************/

/* CHARACTER FORMATS */

/* The following section defines character formats that every HTML Help project should need. */



/* CHARACTER FORMATS Updated to conform with the CSE HTML Validator Pro */

/* The following section defines character formats that every HTML Help project should need. */



/* Use the Dark-Red format for warnings or cautions. */

.Dark-Red { color: #800000 }



/* Use the Monospace format for code or syntax examples. */

.Monospace { font-family: Courier New; font-size: 100%; }



/* Use the Monospace-Bold format for messages and responses that the computer automatically prints to the screen. */

.Monospace-Bold { font-family: Courier New; font-weight: bold; font-size: 100%; }



/* Use the Monospace-Italic format to denote text that is a placeholder for a word or value that the user must supply. */

.Monospace-Italic { font-family: Courier New; font-style: italic; font-size: 100%; }



/* small class */

.smallFont { font-size:87.5%; }



/* Bold class */

.Bold { font-weight: bold; }



/* Italic class */

.Italic { font-style: italic; }



/* Use the Platform format to denote a specific platform. */

.Platform { color: #0000FF; font-weight: bold; }



/* Use the Symbol format for characters not in the Verdana character set. Use this format sparingly. When possible, you should use the correct ASCII code for the symbol or use a graphic to recreate the symbol. */

.Symbol { font-family: Symbol; }



/* Use the Red-text format to call attention to text that needs  information added or edited by techcomm */

.Red-text {color: #FF0000;}



/* Use the Green-Underline format for the green defintion in the conventions topic */

.Green-Underline {color: #007700; text-decoration : underline;}



/* Use the glossButton format for the glossary buttons used in the glossary topic */

.glossButton { font-size:12px; color:black; }



/* Use for text sections and hyphenated words that should not break at line wraps */

.nobreak{white-space:nowrap}



/* Use for template instructions. */

.instructions{color:red; font-style:italic}



/*Use for words and text sections that do not need to be localized */

.DNL { }



/* The following styles define the color of links. */

a:link { color: #007700 }

a:visited { color: #7F007F }

a:link:hover { color: #FF0000 }

a:link:active { color: #FF0000 }



/***************************************************

** Forms */



form { margin-top:0pt; margin-bottom:3pt; color:black; }

select { font-size:100%; color:black; }



/*******************************************************

** Margins **

** Use these styles for block-level elements inside tables cells or list items where you do not want extra padding at the top or bottom of a cell. */

.noTopMargin { margin-top:0pt;}

.noBottomMargin { margin-bottom:0pt;}



/***************************************************

** CODE STYLES **

** The following section defines styles that you need to format entire sections of code or syntax examples. If you have just a few words you need to format as a code or syntax example, use the Monospace character format. */



P.Code { margin-top:3.00pt; margin-bottom:0.00pt; font-family:Courier New;  }

P.Code1 { margin-left:12.00pt; margin-top:3.00pt; margin-bottom:0.00pt; font-family:Courier New;  }

P.Code2 { margin-left:24.00pt; margin-top:3.00pt; margin-bottom:0.00pt; font-family:Courier New;  }

P.Code3 { margin-left:36.00pt; margin-top:3.00pt; margin-bottom:0.00pt; font-family:Courier New;  }

-->
</style>
<script type="text/javascript"> // define hyperlinks and function for launching a URL in a browser

var L_case_structure = "http://digital.ni.com/express.nsf/bycode/ex746b";
var L_while_loops = "http://digital.ni.com/express.nsf/bycode/ext9fg";
var L_shift_registers = "http://digital.ni.com/express.nsf/bycode/exar5k";
var L_enums = "http://digital.ni.com/express.nsf/bycode/ex3zj7";
var L_typedefs = "http://digital.ni.com/express.nsf/bycode/exicsz";
var L_event_structures = "http://digital.ni.com/express.nsf/bycode/exfjrp";
var L_value_change_events = "http://digital.ni.com/express.nsf/bycode/exb2cb";
var L_error_handling = "http://digital.ni.com/express.nsf/bycode/exfbp3";
var L_clusters = "http://digital.ni.com/express.nsf/bycode/exwemq";
var L_control_refnums = "http://digital.ni.com/express.nsf/bycode/exend6";
var L_parallel = "http://digital.ni.com/express.nsf/bycode/exxaf6";
var L_PC = "http://digital.ni.com/express.nsf/bycode/exbfny";
var L_state_machines = "http://digital.ni.com/express.nsf/bycode/ex85gn";
var L_user_events = "http://digital.ni.com/express.nsf/bycode/exgpiv";
var L_queues = "http://digital.ni.com/express.nsf/bycode/extwnb";
var L_schema = "http://digital.ni.com/express.nsf/bycode/exwf6i";
var L_notifiers = "http://digital.ni.com/express.nsf/bycode/exyhme";
var L_libraries = "http://digital.ni.com/express.nsf/bycode/exge57";
var L_trademarks = "http://digital.ni.com/express.nsf/bycode/rdtrad";
var L_patents = "http://digital.ni.com/express.nsf/bycode/rdlv17";
var L_walkthrough = "http://digital.ni.com/express.nsf/bycode/DW_QMH";

function WWW(url) 
	{
	var urlWindow;
	urlWindow = window.open(url, "New", "directories=yes,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
	}
</script>

</HEAD>
<body>

<h1>Continuous Measurement and Logging</h1>
<p class="Body">LabVIEW 2012</p>

<p class="Body">The Continuous Measurement and Logging sample project acquires measurements continuously and logs them to disk. It executes five loops in parallel:</p>
<ul>
	<li>Event handling (Main.vi)&#8212;The Event Handling Loop (EHL) that produces messages based on front panel events, such as the user clicking <strong>Start</strong> or <strong>Settings</strong>.</li>
	<li>User interface messaging (Main.vi)&#8212;A Message Handling Loop (MHL) that receives messages from the EHL and responds by sending messages to the other MHLs.</li>
	<li>Acquiring data (Acquisition.lvlib:Acquisition Message Loop.vi)&#8212;An MHL that continuously acquires data. By default, this template simulates acquired data.</li>
	<li>Logging data (Logging.lvlib:Logging Message Loop.vi)&#8212;An MHL that continuously logs acquired data.</li>
	<li>Displaying data (Main.vi)&#8212;A While Loop that updates the waveform chart with acquired data.</li>
</ul>

<p class="Body">This sample project also features a <strong>Settings</strong> dialog box (Settings.lvlib) you can use to configure the application.</p>
<p class="Body">This sample project is based on the Queued Message Handler template. Refer to the Queued Message Handler template and its documentation, available from the <strong>Create Project</strong> dialog box, for information about how this template works.</p>

<h2>Developer Walkthrough</h2>
<p class="Body">Refer to <a href="javascript:WWW(L_walkthrough)">ni.com</a> for a developer walkthrough of the Queued Message Handler template.</p>

<h2>System Requirements</h2>
<p class="body">LabVIEW Base, Full, or Professional Development System. This sample project is designed for use with NI-DAQmx, an instrument driver, or other driver software.</p>

<h2>Use Cases</h2>
<p class="Body">The Continuous Measurement and Logging sample project is designed for a continuous measurement application that requires a responsive user interface; that is, users should be able to click buttons even while the application is executing another command.</p>

<h2>Running this Sample Project</h2>
<ol>
	<li>In the <strong>Project Explorer</strong> window, open and run Main.vi.</li>
	<li>Click <strong>Start</strong>. The program begins acquiring simulated waveform data.</li>
	<li>Click the other front panel buttons to explore the sample project.</li>
</ol>

<h2>Modifying this Sample Project</h2>

<h3>Adding Data Acquisition Code</h3>
<p class="Body">You must modify the sample project to acquire data from hardware. Complete the following steps to make these modifications:</p>
<ol>
	<li>Add hardware refnums to Acquisition.lvlib:Hardware Configuration.ctl. For example, you can use the following objects here:
	<ul>
		<li>DAQ tasks</li>
		<li>DAQ channels</li>
		<li>VISA sessions</li>
	</ul>
	</li>
	<li>Add hardware initialization code to Acquisition.lvlib:Initialize Hardware References.vi. For example, you can use the following objects here:
		<ul>
			<li>DAQmx Task Name constants</li>
			<li>DAQmx Create Virtual Channel VI</li>
			<li>(Instrument Driver) Initialize VI</li>
		</ul>
	</li>
	<li>Add hardware configuration code to Acquisition.lvlib:Configure Hardware.vi For example, you can use the following VIs here:
		<ul>
			<li>DAQmx Timing VI</li>
			<li>DAQmx Trigger VI</li>
			<li>(Instrument Driver) Configure Measurement VI</li>
			<li>(Instrument Driver) Configure Autozero VI</li>

		</ul>
	</li>
	<li>Add data acquisition code to Acquisition.lvlib:Acquire.vi. For example, you can use the following VIs here:
		<ul>
			<li>DAQmx Read VI</li>
			<li>(Instrument Driver) Read VI</li>
		</ul>
	</li>
	<li>Add code that stops data acquisition to Acquisition.lvlib:Stop Acquisition.vi. For example, you can use the following VIs here:
		<ul>
			<li>DAQmx Clear Task VI</li>
			<li>(Instrument Driver) Close VI</li>
		</ul>
	</li>
</ol>

<h3>Customizing Data Logging Code</h3>
<p class="Body">If the default logging behavior does not meet the needs of your application, you can modify this sample project in the following ways:</p>
<ul>
	<li>To specify where data is logged, run Main.vi, click <strong>Settings</strong>, and use the <strong>Log File Path</strong> control. By default, this template logs data to <span id="Monospace"><em>LabVIEW Data</em>\Logged Data.tdms</span>, where <span id="Monospace"><em>LabVIEW Data</em></span> is the LabVIEW Data folder.</li>
	<li>To change the data logging mechanism, modify Logging.lvlib:Logging Message Loop.vi. For example, you could modify this VI to stream acquired data across a network or to disk.</li>
	<li>To change the code that writes data to disk, modify Logging.lvlib:Log Data.vi. For example, you could use the Export Waveforms to Spreadsheet File or Write to Spreadsheet File VIs. By default, this template uses the TDMS functions to log data to a <span id="Monospace">.tdms</span> file.</li>
	<li>To change or add path and file refnums that are needed for data logging, modify Logging.lvlib:Logging Configuration.ctl.</li>
</ul>

<h2>LabVIEW Features and Concepts Used</h2>

<ul>
	<li><a href="javascript:WWW(L_case_structure)">Case structures</a></li>
	<li><a href="javascript:WWW(L_clusters)">Clusters</a></li>
	<li><a href="javascript:WWW(L_control_refnums)">Control refnums</a></li>
	<li><a href="javascript:WWW(L_enums)">Enums</a></li>
	<li><a href="javascript:WWW(L_error_handling)">Error clusters</a></li>
	<li><a href="javascript:WWW(L_event_structures)">Event structures</a></li>
	<li><a href="javascript:WWW(L_schema)">LabVIEW Schema VIs and Functions</a></li>
	<li><a href="javascript:WWW(L_notifiers)">Notifiers</a></li>
	<li><a href="javascript:WWW(L_parallel)">Parallelism</a></li>
	<li><a href="javascript:WWW(L_PC)">Producer/Consumer design pattern</a></li>
	<li><a href="javascript:WWW(L_libraries)">Project libraries</a></li>
	<li><a href="javascript:WWW(L_queues)">Queues</a></li>
	<li><a href="javascript:WWW(L_shift_registers)">Shift registers</a></li>
	<li><a href="javascript:WWW(L_state_machines)">State machines</a></li>
	<li><a href="javascript:WWW(L_typedefs)">Typedefs</a></li>
	<li><a href="javascript:WWW(L_value_change_events)">Value change events</a></li>
	<li><a href="javascript:WWW(L_user_events)">User events</a></li>
	<li><a href="javascript:WWW(L_while_loops)">While Loops</a></li>
</ul>

<hr>
<h2>Important Information</h2>
<!--Copyright-->
<p class="Body"><strong>Copyright</strong></p>
<p class="Body">&#0169; 2012 National Instruments. All rights reserved.</p>

<p class="Body">Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.</p>

<p class="Body">National Instruments respects the intellectual property of others, and we ask our users to do the same.  NI software is protected by copyright and other intellectual property laws.  Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.</p>

<p class="Body"><strong>End-User License Agreements and Third-Party Legal Notices</strong></p>
<p class="Body">You can find end-user license agreements (EULAs) and third-party legal notices in the following locations:</p>
<ul>
<li>Notices are located in the <span class="Monospace">&lt;National Instruments&gt;\_Legal Information</span> and <span class="Monospace">&lt;National Instruments&gt;</span> directories.</li> 
<li>EULAs are located in the <span class="Monospace">&lt;National Instruments&gt;\Shared\MDF\Legal\license</span> directory.</li>
<li>Review <span class="Monospace">&lt;National Instruments&gt;\_Legal Information.txt</span> for information on including legal information in installers built with NI products.</li>
</ul>

<!--Trademarks-->
<p class="Body"><strong>Trademarks</strong></p>

<p class="Body"><span class="DNL">LabVIEW</span>, <span class="DNL">National Instruments</span>, <span class="DNL">NI</span>, <span class="DNL">ni.com</span>, the <span class="DNL">National Instruments</span> corporate logo, and the Eagle logo are trademarks of <span class="DNL">National Instruments Corporation</span>. Refer to the <em><span class="DNL">Trademark Information</span></em> at <span class="Monospace">ni.com/trademarks</span> for other <a href="javascript:WWW(L_trademarks)"><span class="DNL">National Instruments</span> trademarks</a>.</p>

<p class="Body">Other product and company names mentioned herein are trademarks or trade names of their respective companies.</p>

<!--Patents-->
<p class="Body"><strong>Patents</strong></p>
<p class="Body">For patents covering the National Instruments products/technology, refer to the appropriate location: <strong>Help&#0187;Patents</strong> in your software, the <span class="Monospace">patents.txt</span> file on your media, or the <a href="javascript:WWW(L_patents)">National Instruments Patent Notice</a> at <span class="Monospace">ni.com/patents</span>.</p>
</body>
</html>